package com.xiaoxu.content.controller;

import com.xiaoxu.content.model.dto.CoursePreviewDto;
import com.xiaoxu.content.service.CoursePublishService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xiaoxu
 * @version 1.0
 * @description TODO
 * @date 2023/1/29 21:05
 */
@Api(value = "课程公开查询接口",tags = "课程公开查询接口")
@RestController
@RequestMapping("/open")
public class CourseOpenController {
    private final CoursePublishService coursePublishService;

    public CourseOpenController(CoursePublishService coursePublishService) {
        this.coursePublishService = coursePublishService;
    }


    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto getPreviewInfo(@PathVariable("courseId") Long courseId) {
        //获取课程预览信息
        return coursePublishService.getCoursePreviewInfo(courseId);
    }

}
